﻿@model DTcms.Model.siteconfig
@{
    List<SelectListItem> list = new List<SelectListItem>(){
        new SelectListItem(){Text="Arial", Value="Arial"},
        new SelectListItem(){Text="Arial Black", Value="Arial Black"},
        new SelectListItem(){Text="Batang", Value="Batang"},
        new SelectListItem(){Text="BatangChe",Value="BatangChe"},
        new SelectListItem(){Text="Comic Sans MS",Value="Comic Sans MS"},
        new SelectListItem(){Text="Courier New",Value="Courier New"},
        new SelectListItem(){Text="Dotum",Value="Dotum"},
        new SelectListItem(){Text="DotumChe",Value="DotumChe"},
        new SelectListItem(){Text="Estrangelo Edessa",Value="Estrangelo Edessa"},
        new SelectListItem(){Text="Franklin Gothic Medium",Value="Franklin Gothic Medium"},
        new SelectListItem(){Text="Gautami",Value="Gautami"},
        new SelectListItem(){Text="Georgia",Value="Georgia"},
        new SelectListItem(){Text="Gulim",Value="Gulim"},
        new SelectListItem(){Text="GulimChe",Value="GulimChe"},
        new SelectListItem(){Text="Gungsuh",Value="Gungsuh"},
        new SelectListItem(){Text="GungsuhChe",Value="GungsuhChe"},
        new SelectListItem(){Text="Impact",Value="Impact"},
        new SelectListItem(){Text="Latha",Value="Latha"},
        new SelectListItem(){Text="Lucida Console",Value="Lucida Console"},
        new SelectListItem(){Text="Lucida Sans Unicode",Value="Lucida Sans Unicode"},
        new SelectListItem(){Text="Mangal",Value="Mangal"},
        new SelectListItem(){Text="Marlett",Value="Marlett"},
        new SelectListItem(){Text="Microsoft Sans Serif",Value="Microsoft Sans Serif"},
        new SelectListItem(){Text="MingLiU",Value="MingLiU"},
        new SelectListItem(){Text="MS Gothic",Value="MS Gothic"},
        new SelectListItem(){Text="MS Mincho",Value="MS Mincho"},
        new SelectListItem(){Text="MS PGothic",Value="MS PGothic"},
        new SelectListItem(){Text="MS PMincho",Value="MS PMincho"},
        new SelectListItem(){Text="MS UI Gothic",Value="MS UI Gothic"},
        new SelectListItem(){Text="MV Boli",Value="MV Boli"},
        new SelectListItem(){Text="Palatino Linotype",Value="Palatino Linotype"},
        new SelectListItem(){Text="PMingLiU",Value="PMingLiU"},
        new SelectListItem(){Text="Raavi",Value="Raavi"},
        new SelectListItem(){Text="Shruti",Value="Shruti"},
        new SelectListItem(){Text="Sylfaen",Value="Sylfaen"},
        new SelectListItem(){Text="Symbol",Value="Symbol"},
        new SelectListItem(){Text="Tahoma",Value="Tahoma"},
        new SelectListItem(){Text="Times New Roman",Value="Times New Roman"},
        new SelectListItem(){Text="Trebuchet MS",Value="Trebuchet MS"},
        new SelectListItem(){Text="Tunga",Value="Tunga"},
        new SelectListItem(){Text="Verdana",Value="Verdana"},
        new SelectListItem(){Text="Webdings",Value="Webdings"},
        new SelectListItem(){Text="Wingdings",Value="Wingdings"},
        new SelectListItem(){Text="仿宋_GB2312",Value="仿宋_GB2312"},
        new SelectListItem(){Text="宋体",Value="宋体"},
        new SelectListItem(){Text="新宋体",Value="新宋体"},
        new SelectListItem(){Text="楷体_GB2312",Value="楷体_GB2312"},
        new SelectListItem(){Text="黑体",Value="黑体"}
    };
}
<form id="form1" class="layui-form" url="SysConfigSave">
    @Html.AntiForgeryToken()
    <!--导航栏-->
    <div class="pageheader">
        <div class="page-bar">
            <ul class="page-breadcrumb">
                <li><a href="javascript:;"><i class="iconfont icon-home1"></i> 首页</a> </li>
                <li><a href="javascript:;">系统参数设置</a> </li>
            </ul>
        </div>
    </div>
    <!--/导航栏-->
    <!--内容-->
    <div class="layui-fluid">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title" id="floatHead">
                <li class="layui-this">系统基本信息</li>
                <li>功能权限设置</li>
                <li>短信平台设置</li>
                <li>邮件发送设置</li>
                <li>文件服务器</li>
                <li>文件上传设置</li>
                <li>其它扩展设置</li>
            </ul>
            <div class="layui-tab-content">
                <!--主站基本信息-->
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label">主站名称</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webname", Model.webname, new { @class = "input normal", datatype = "*2-255", sucmsg = " " })
                            <span class="Validform_checktip">*任意字符，控制在255个字符内</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">主站域名</label>
                        <div class="layui-input-block">
                            @Html.TextBox("weburl", Model.weburl, new { @class = "input normal", datatype = "url", sucmsg = " " })
                            <span class="Validform_checktip">*以“http://”开头，不能绑定到频道分类</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">公司名称</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webcompany", Model.webcompany, new { @class = "input normal" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">通讯地址</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webaddress", Model.webaddress, new { @class = "input normal" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">客服电话</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webtel", Model.webtel, new { @class = "input normal" })
                            <span class="Validform_checktip">*非必填，区号+电话号码</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">传真号码</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webfax", Model.webfax, new { @class = "input normal" })
                            <span class="Validform_checktip">*非必填，区号+传真号码</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">管理员邮箱</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webmail", Model.webmail, new { @class = "input normal" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">主站备案号</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webcrod", Model.webcrod, new { @class = "input normal" })
                        </div>
                    </div>
                </div>
                <!--/主站基本信息-->
                <!--功能权限设置-->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站安装目录</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webpath", Model.webpath, new { @class = "input txt", datatype = "*1-100", sucmsg = " " })
                            <span class="Validform_checktip">*根目录输入“/”，其它输入“/目录名/”</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">后台管理目录</label>
                        <div class="layui-input-block">
                            @Html.TextBox("webmanagepath", Model.webmanagepath, new { @class = "input txt", datatype = "*1-100", sucmsg = " " })
                            <span class="Validform_checktip">*默认admin，其它请输入目录名，否则无法进入后台</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">URL重写开关</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("staticstatus", 0, Model.staticstatus == 0, new { title = "关闭", id = "staticstatus_0" })
                            @Html.RadioButton("staticstatus", 1, Model.staticstatus == 1, new { title = "URL", id = "staticstatus_1" })
                            @Html.RadioButton("staticstatus", 2, Model.staticstatus == 2, new { title = "生成静态", id = "staticstatus_2" })
                            @Html.RadioButton("staticstatus", 3, Model.staticstatus == 3, new { title = "局部静态+URL", id = "staticstatus_3" })
                            <span class="Validform_checktip">*URL配置规则，点击这里查看说明</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">静态URL后缀</label>
                        <div class="layui-input-block">
                            @Html.TextBox("staticextension", Model.staticextension, new { @class = "input small", datatype = "*1-100", sucmsg = " " })
                            <span class="Validform_checktip">*扩展名，不包括“.”，访问或生成时将会替换此值，如：aspx、html</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开启会员功能</label>
                        <div class="layui-input-block">
                            @Html.CheckBox("memberstatus", Model.memberstatus == 1, new { title = "是" })
                            <span class="Validform_checktip">*关闭后关联会员的内容将失效</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开启评论审核</label>
                        <div class="layui-input-block">
                            @Html.CheckBox("commentstatus", Model.commentstatus == 1, new { title = "是" })
                            <span class="Validform_checktip">*开启后评论将会审核才显示</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开启用户评论通知</label>
                        <div class="layui-input-block">
                            @Html.CheckBox("commentsemail", Model.commentsemail == 1, new { title = "是" })
                            <span class="Validform_checktip">*开启后用户评论发送管理员邮箱</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开启管理日志</label>
                        <div class="layui-input-block">
                            @Html.CheckBox("logstatus", Model.logstatus == 1, new { title = "是" })
                            <span class="Validform_checktip">*开启后将会记录管理员在后台的操作日志</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否开启网站</label>
                        <div class="layui-input-block">
                            @Html.CheckBox("webstatus", Model.webstatus == 1, new { title = "是" })
                            <span class="Validform_checktip">*关闭后网站前台将不能访问</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站关闭原因</label>
                        <div class="layui-input-block">
                            @Html.TextArea("webclosereason", Model.webclosereason, new { @class = "input" })
                            <span class="Validform_checktip">支持HTML</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站统计代码</label>
                        <div class="layui-input-block">
                            @Html.TextArea("webcountcode", Model.webcountcode, new { @class = "input" })
                            <span class="Validform_checktip">支持HTML</span>
                        </div>
                    </div>
                </div>
                <!--/功能权限设置-->
                <!--手机短信设置-->
                <div class="layui-tab-item">
                    <div class="usertab">
                        <div class="layui-form-item">
                            <label class="layui-form-label">短信平台</label>
                            <div class="layui-input-block">
                                @Html.RadioButton("smsplatform", "DTcms", Model.smsplatform == "DTcms" || Model.smsplatform == "", new { title = "DTcms", id = "smsplatform_0" })
                                @Html.RadioButton("smsplatform", "aliyun", Model.smsplatform == "aliyun", new { title = "阿里云", id = "smsplatform_1" })
                                @Html.RadioButton("smsplatform", "ccp", Model.smsplatform == "ccp", new { title = "云通讯", id = "smsplatform_2" })
                                @Html.RadioButton("smsplatform", "ums86", Model.smsplatform == "ums86", new { title = "Ums", id = "smsplatform_3" })
                                @Html.RadioButton("smsplatform", "sendcloud", Model.smsplatform == "sendcloud", new { title = "SendCloud", id = "smsplatform_4" })
                                <span class="Validform_checktip"></span>
                            </div>
                            <div class="layui-input-block">
                                <p>阿里云采用Json格式：{"username":"{username}","webname":"{webname}"}</p>
                                <p>云通讯采用数组 数据格式：{username},{webname} 后台自动分割</p>
                                <p>后台进行{username}值替换</p>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">@ViewBag.SmsTip</label>
                            <div class="layui-input-block">
                                <div class="smscount">@Html.Raw(ViewBag.SmsCount)</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">平台登录账户/Key</label>
                            <div class="layui-input-block">
                                @Html.TextBox("smsusername", Model.smsusername, new { @class = "input txt" })
                                <span class="Validform_checktip">*短信平台注册的用户名,{uid}</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">平台登录密码/Secret</label>
                            <div class="layui-input-block">
                                @Html.Password("smspassword", Model.smspassword, new { @class = "input txt" })
                                <span class="Validform_checktip">*短信平台注册的密码,{pass}</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">企业编号</label>
                            <div class="layui-input-block">
                                @Html.Password("smsapicode", Model.smsapicode, new { @class = "input txt" })
                                <span class="Validform_checktip"></span>
                            </div>
                        </div>
                        <div id="SignBox" class="layui-form-item">
                            <label class="layui-form-label">签名</label>
                            <div class="layui-input-block">
                                @Html.TextBox("smssigntxt", Model.smssigntxt, new { @class = "input txt" })
                                <span class="Validform_checktip"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否加入签名</label>
                            <div class="layui-input-block">
                                <div class="SignBox">
                                    @Html.RadioButton("smssign", 0, Model.smssign == 0, new { title = "关闭", id = "smssign_0" })
                                    @Html.RadioButton("smssign", 1, Model.smssign == 1, new { title = "签名在前", id = "smssign_1" })
                                    @Html.RadioButton("smssign", 2, Model.smssign == 2, new { title = "签名在后", id = "smssign_2" })
                                </div>
                                <span class="Validform_checktip">*如：短信+【公司名称】</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">响应结果类型</label>
                            <div class="layui-input-block">
                                <div class="SendBox">
                                    @Html.RadioButton("smssendanswer", 0, Model.smssendanswer == 0, new { title = "文本", id = "smssendanswer_0" })
                                    @Html.RadioButton("smssendanswer", 1, Model.smssendanswer == 1, new { title = "Json", id = "smssendanswer_1" })
                                    @Html.RadioButton("smssendanswer", 2, Model.smssendanswer == 2, new { title = "XML", id = "smssendanswer_2" })
                                </div>
                                <span class="Validform_checktip"></span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">批量间隔符</label>
                            <div class="layui-input-block">
                                @Html.TextBox("smsmark", Model.smsmark, new { @class = "input small" })
                                <span class="Validform_checktip">*默认为逗号</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">24小时允许发送次数</label>
                            <div class="layui-input-block">
                                @Html.TextBox("smssendcount", Model.smssendcount, new { @class = "input small" })
                                <span class="Validform_checktip">*默认为10，24小时同一手机号最大允许发送次数，0代表不限制</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">同一IP单日允许发送总数</label>
                            <div class="layui-input-block">
                                @Html.TextBox("smsipcount", Model.smsipcount, new { @class = "input small" })
                                <span class="Validform_checktip">*默认为20，24小时同一IP号最大允许发送次数，0代表不限制</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">平台单日最大允许发送总数</label>
                            <div class="layui-input-block">
                                @Html.TextBox("smssafecount", Model.smssafecount, new { @class = "input small" })
                                <span class="Validform_checktip">*默认为1000</span>
                            </div>
                        </div>
                    </div>
                </div>
                <!--/手机短信设置-->
                <!--邮件发送设置-->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">SMTP服务器</label>
                        <div class="layui-input-block">
                            @Html.TextBox("emailsmtp", Model.emailsmtp, new { @class = "input normal", datatype = "*0-100", sucmsg = " " })
                            <span class="Validform_checktip">*发送邮件的SMTP服务器地址</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">SSL加密连接</label>
                        <div class="layui-input-block">
                            @Html.CheckBox("emailssl", Model.emailssl == 1, new { title = "是" })
                            <span class="Validform_checktip">*是否启用SSL加密连接</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">SMTP端口</label>
                        <div class="layui-input-block">
                            @Html.TextBox("emailport", Model.emailport, new { @class = "input small", datatype = "n", sucmsg = " " })
                            <span class="Validform_checktip">*SMTP服务器的端口，大部分服务商都支持25端口</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">发件人地址</label>
                        <div class="layui-input-block">
                            @Html.TextBox("emailfrom", Model.emailfrom, new { @class = "input normal", datatype = "e", sucmsg = " " })
                            <span class="Validform_checktip">*发件人的邮箱地址</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">邮箱账号</label>
                        <div class="layui-input-block">
                            @Html.TextBox("emailusername", Model.emailusername, new { @class = "input normal", datatype = "*0-100", sucmsg = " " })
                            <span class="Validform_checktip">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">邮箱密码</label>
                        <div class="layui-input-block">
                            @Html.Password("emailpassword", Model.emailpassword, new { @class = "input normal", datatype = "*0-100", sucmsg = " " })
                            <span class="Validform_checktip">*</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">发件人昵称</label>
                        <div class="layui-input-block">
                            @Html.TextBox("emailnickname", Model.emailnickname, new { @class = "input normal", datatype = "*0-50", sucmsg = " " })
                            <span class="Validform_checktip">*对方收到邮件时显示的昵称</span>
                        </div>
                    </div>
                </div>
                <!--/邮件发送设置-->
                <!--文件服务器-->
                <div class="layui-tab-item">
                    <div id="saveCtrol">
                        <div class="core">
                            <div class="layui-form-item">
                                <label class="layui-form-label">类型</label>
                                <div class="layui-input-block core">
                                    @Html.RadioButton("fileserver", "localhost", Model.fileserver == "localhost", new { title = "本地存储", id = "fileserver_0" })
                                    @Html.RadioButton("fileserver", "domain", Model.fileserver == "domain", new { title = "本地跨域", id = "fileserver_1" })
                                    @Html.RadioButton("fileserver", "aliyun", Model.fileserver == "aliyun", new { title = "阿里云OSS", id = "fileserver_2" })
                                    <span class="Validform_checktip">*非本地存储请申请开通云存储完善设置</span>
                                </div>
                            </div>
                        </div>
                        <div class="pannel">
                            <div class="box"></div>
                            <div class="box">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">保存路径</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("domainpath", Model.domainpath, new { @class = "input normal" })
                                        <span class="Validform_checktip">*请使用绝对路径；如：D:\upload</span>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">绑定域名</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("domainbind", Model.domainbind, new { @class = "input normal" })
                                        <span class="Validform_checktip">*绑定的域名</span>
                                    </div>
                                </div>
                            </div>
                            <div class="box">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">阿里云KeyId</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("accessid", Model.accessid, new { @class = "input normal", datatype = "*0-255", sucmsg = " " })
                                        <span class="Validform_checktip">*阿里云OSS对象存储的Access KeyId</span>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">阿里云SecretKey</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("accesssecret", Model.accesssecret, new { @class = "input normal", datatype = "*0-255", sucmsg = " " })
                                        <span class="Validform_checktip">*阿里云OSS对象存储的Access KeySecret</span>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">阿里云Bucket</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("spacename", Model.spacename, new { @class = "input normal", datatype = "*0-255", sucmsg = " " })
                                        <span class="Validform_checktip">*阿里云OSS对象存储的存储空间名称</span>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">阿里云EndPoint</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("endpoint", Model.endpoint, new { @class = "input normal", datatype = "*0-255", sucmsg = " " })
                                        <span class="Validform_checktip">*阿里云OSS对象存储的区域外网(不含http://)</span>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">阿里云绑定域名</label>
                                    <div class="layui-input-block">
                                        @Html.TextBox("spaceurl", Model.spaceurl, new { @class = "input normal", datatype = "*0-255", sucmsg = " " })
                                        <span class="Validform_checktip">*阿里云OSS对象存储的自定义访问域名(不含http://)</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--/文件服务器-->
                <!--上传配置-->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">文件上传目录</label>
                        <div class="layui-input-block">
                            @Html.TextBox("filepath", Model.filepath, new { @class = "input normal", datatype = "/^[a-zA-z]{2,}$/" })
                            <span class="Validform_checktip">*文件保存的目录名，自动创建根目录下</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文件保存方式</label>
                        <div class="layui-input-block">
                            @Html.DropDownList("filesave", new List<SelectListItem>{
                                new SelectListItem(){ Text = "按年月日每天一个目录", Value = "0", Selected = (Model.filesave == 0)},
                                new SelectListItem(){ Text = "按年月/日/存入不同目录", Value = "1", Selected = (Model.filesave == 1)}
                             })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">编辑器图片</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("fileremote", "0", Model.fileremote == 0, new { title = "关闭下载", id = "fileremote_0" })
                            @Html.RadioButton("fileremote", "1", Model.fileremote == 1, new { title = "自动下载", id = "fileremote_1" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片上传类型</label>
                        <div class="layui-input-block">
                            @Html.TextBox("imgextension", Model.imgextension, new { @class = "input normal", datatype = "*1-500", sucmsg = " " })
                            <span class="Validform_checktip">*以英文的逗号分隔开，如：“.jpg,.png”</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文件上传类型</label>
                        <div class="layui-input-block">
                            @Html.TextBox("attachextension", Model.attachextension, new { @class = "input normal", datatype = "*1-500", sucmsg = " " })
                            <span class="Validform_checktip">*以英文的逗号分隔开，如：“zip,rar”</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">视频上传类型</label>
                        <div class="layui-input-block">
                            @Html.TextBox("videoextension", Model.videoextension, new { @class = "input normal", datatype = "*1-500", sucmsg = " " })
                            <span class="Validform_checktip">*以英文的逗号分隔开，如：“mp4,flv”</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片上传大小</label>
                        <div class="layui-input-block">
                            @Html.TextBox("imgsize", Model.imgsize, new { @class = "input small", datatype = "n", sucmsg = " " }) KB
                            <span class="Validform_checktip">*超过设定的图片大小不予上传，0不限制</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">附件上传大小</label>
                        <div class="layui-input-block">
                            @Html.TextBox("attachsize", Model.attachsize, new { @class = "input small", datatype = "n", sucmsg = " " }) KB
                            <span class="Validform_checktip">*超过设定的文件大小不予上传，0不限制</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">视频上传大小</label>
                        <div class="layui-input-block">
                            @Html.TextBox("videosize", Model.videosize, new { @class = "input small", datatype = "n", sucmsg = " " }) KB
                            <span class="Validform_checktip">*超过设定的文件大小不予上传，0不限制</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片最大尺寸</label>
                        <div class="layui-input-block">
                            @Html.TextBox("imgmaxheight", Model.imgmaxheight, new { @class = "input small", datatype = "n", sucmsg = " " }) ×
                            @Html.TextBox("imgmaxwidth", Model.imgmaxwidth, new { @class = "input small", datatype = "n", sucmsg = " " }) px
                            <span class="Validform_checktip">*左边高度，右边宽度，超出自动裁剪，0为不受限制</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">缩略图生成尺寸</label>
                        <div class="layui-input-block">
                            @Html.TextBox("thumbnailheight", Model.thumbnailheight, new { @class = "input small", datatype = "n", sucmsg = " " }) ×
                            @Html.TextBox("thumbnailwidth", Model.thumbnailwidth, new { @class = "input small", datatype = "n", sucmsg = " " }) px
                            <span class="Validform_checktip">*左边高度，右边宽度，0为不生成缩略图</span>
                        </div>
                    </div>
                    <div id="imgCtrol">
                        <div class="core">
                            <div class="layui-form-item">
                                <label class="layui-form-label">图片处理插件</label>
                                <div class="layui-input-block">
                                    @Html.RadioButton("imgplugin", "0", Model.imgplugin == 0, new { title = "系统默认", id = "imgplugin_0" })
                                    @Html.RadioButton("imgplugin", "1", Model.imgplugin == 1, new { title = "ImageMagick", id = "imgplugin_1" })
                                    <span class="Validform_checktip">*默认为“系统默认”</span>
                                </div>
                            </div>
                        </div>
                        <div class="pannel">
                            <div class="box"></div>
                            <div class="box">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">文件类型转换</label>
                                    <div class="layui-input-block">
                                        @Html.RadioButton("imgconvert", "jpg", Model.imgconvert == "jpg", new { title = "关闭", id = "imgconvert_0" })
                                        @Html.RadioButton("imgconvert", "png", Model.imgconvert == "png", new { title = "Jpg", id = "imgconvert_1" })
                                        @Html.RadioButton("imgconvert", "gif", Model.imgconvert == "gif", new { title = "Png", id = "imgconvert_2" })
                                        @Html.RadioButton("imgconvert", "webp", Model.imgconvert == "webp", new { title = "WebP", id = "imgconvert_3" })
                                        <span class="Validform_checktip">*默认为“关闭”,如果服务器支持WebP，强烈建议使用WebP格式！</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">缩略图生成方式</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("thumbnailmode", "Cut", Model.thumbnailmode == "Cut", new { title = "裁剪", id = "thumbnailmode_0" })
                            @Html.RadioButton("thumbnailmode", "HWB", Model.thumbnailmode == "HWB", new { title = "指定高宽缩放（补白）", id = "thumbnailmode_1" })
                            @Html.RadioButton("thumbnailmode", "W", Model.thumbnailmode == "W", new { title = "指定宽，高按比例", id = "thumbnailmode_2" })
                            @Html.RadioButton("thumbnailmode", "H", Model.thumbnailmode == "H", new { title = "指定高，宽按比例", id = "thumbnailmode_3" })
                            @Html.RadioButton("thumbnailmode", "HW", Model.thumbnailmode == "HW", new { title = "指定高宽缩放", id = "thumbnailmode_4" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片水印类型</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("watermarktype", 0, Model.watermarktype == 0, new { title = "关闭水印", id = "watermarktype_0" })
                            @Html.RadioButton("watermarktype", 1, Model.watermarktype == 1, new { title = "文字水印", id = "watermarktype_1" })
                            @Html.RadioButton("watermarktype", 2, Model.watermarktype == 2, new { title = "图片水印", id = "watermarktype_2" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片水印位置</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("watermarkposition", 1, Model.watermarkposition == 1, new { title = "中上", id = "watermarkposition_1" })
                            @Html.RadioButton("watermarkposition", 2, Model.watermarkposition == 2, new { title = "中上", id = "watermarkposition_2" })
                            @Html.RadioButton("watermarkposition", 3, Model.watermarkposition == 3, new { title = "右上", id = "watermarkposition_3" })
                            @Html.RadioButton("watermarkposition", 4, Model.watermarkposition == 4, new { title = "左中", id = "watermarkposition_4" })
                            @Html.RadioButton("watermarkposition", 5, Model.watermarkposition == 5, new { title = "居中", id = "watermarkposition_5" })
                            @Html.RadioButton("watermarkposition", 6, Model.watermarkposition == 6, new { title = "右中", id = "watermarkposition_6" })
                            @Html.RadioButton("watermarkposition", 7, Model.watermarkposition == 7, new { title = "左下", id = "watermarkposition_7" })
                            @Html.RadioButton("watermarkposition", 8, Model.watermarkposition == 8, new { title = "中下", id = "watermarkposition_8" })
                            @Html.RadioButton("watermarkposition", 9, Model.watermarkposition == 9, new { title = "右下", id = "watermarkposition_9" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片生成质量</label>
                        <div class="layui-input-block">
                            @Html.TextBox("watermarkimgquality", Model.watermarkimgquality, new { @class = "input small", datatype = "n", sucmsg = " " })
                            <span class="Validform_checktip">*只适用于加水印的jpeg格式图片.取值范围 0-100, 0质量最低, 100质量最高, 默认80</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片水印文件</label>
                        <div class="layui-input-block">
                            @Html.TextBox("watermarkpic", Model.watermarkpic, new { @class = "input normal upload-path" })
                            <div class="upload-box upload-img"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印透明度</label>
                        <div class="layui-input-block">
                            @Html.TextBox("watermarktransparency", Model.watermarktransparency, new { @class = "input small", datatype = "n", sucmsg = " " })
                            <span class="Validform_checktip">*取值范围1--10 (10为不透明)</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印文字</label>
                        <div class="layui-input-block">
                            @Html.TextBox("watermarktext", Model.watermarktext, new { @class = "input txt", datatype = "s2-100", sucmsg = " " })
                            <span class="Validform_checktip">*文字水印的内容</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文字字体</label>
                        <div class="layui-input-block">
                            @Html.DropDownList("watermarkfont", new SelectList(list, "Value", "Text", Model.watermarkfont))
                            @Html.TextBox("watermarkfontsize", Model.watermarkfontsize, new { @class = "input small", datatype = "n", sucmsg = " " }) px
                            <span class="Validform_checktip">*文字水印的字体和大小 </span>
                        </div>
                    </div>
                </div>
                <!--/上传配置-->
                <!--其它扩展设置-->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">后台使用语言</label>
                        <div class="layui-input-block">
                            @Html.TextBox("AdminLanguages", Model.AdminLanguages, new { @class = "input normal", datatype = "*", sucmsg = " " })
                            <span class="Validform_checktip"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">IP禁止访问列表：</label>
                        <div class="layui-input-block">
                            <textarea class="input" name="IpDenyAccess" id="IpDenyAccess" placeholder="IP禁止访问列表">@Model.IpDenyAccess</textarea>
                            <span class="Validform_checktip">每个IP占一行,支持IP段。如：192.168.0.1-192.168.0.255</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">后台IP访问列表：</label>
                        <div class="layui-input-block">
                            <textarea class="input" name="AdminIpAccess" id="AdminIpAccess" placeholder="后台IP访问列表">@Model.AdminIpAccess</textarea>
                            <span class="Validform_checktip">填写了只有允许的IP才能访问</span>
                        </div>
                    </div>
                    <div id="divCache">
                        <div class="layui-form-item core">
                            <label class="layui-form-label">开启页面缓存</label>
                            <div class="layui-input-block">
                                @Html.CheckBox("systemcache", Model.systemcache == 1, new { title = "是" })
                                <span class="Validform_checktip">*开启后需重新重新应用模板</span>
                            </div>
                        </div>
                        <div class="pannel">
                            <div class="layui-form-item">
                                <label class="layui-form-label">缓存时间</label>
                                <div class="layui-input-block">
                                    @Html.TextBox("cachetime", Model.cachetime, new { @class = "input", datatype = "n", sucmsg = " " })
                                    <span class="Validform_checktip">*单位（分钟）默认 3</span>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">缓存标识</label>
                                <div class="layui-input-block">
                                    @Html.TextBox("cachekey", Model.cachekey, new { @class = "input", datatype = "*", sucmsg = " " })
                                    <span class="Validform_checktip">*默认为“CacheKey”</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">启用后台HTML压缩</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("admingzip", 0, Model.admingzip == 0, new { title = "否", id = "admingzip_0" })
                            @Html.RadioButton("admingzip", 1, Model.admingzip == 1, new { title = "是", id = "admingzip_1" })
                            <span class="Validform_checktip">*开启后将压缩HTML</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">启用前台HTML压缩</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("webgzip", 0, Model.webgzip == 0, new { title = "否", id = "webgzip_0" })
                            @Html.RadioButton("webgzip", 1, Model.webgzip == 1, new { title = "是", id = "webgzip_1" })
                            <span class="Validform_checktip">*开启后将压缩HTML</span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">插件删除操作：</label>
                        <div class="layui-input-block">
                            @Html.RadioButton("deltable", 0, Model.deltable == 0, new { title = "删除数据库", id = "deltable_0" })
                            @Html.RadioButton("deltable", 1, Model.deltable == 1, new { title = "保留数据库", id = "deltable_1" })
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章作者</label>
                        <div class="layui-input-block">
                            @Html.TextBox("author", Model.author, new { @class = "input normal", datatype = "*", sucmsg = " " })
                            <span class="Validform_checktip"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章来源</label>
                        <div class="layui-input-block">
                            @Html.TextBox("source", Model.source, new { @class = "input normal", datatype = "*", sucmsg = " " })
                            <span class="Validform_checktip"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">微信关注</label>
                        <div class="layui-input-block">
                            @Html.TextBox("followwx", Model.followwx, new { @class = "input normal upload-path" })
                            <div class="upload-box choose-pick"><a href="javascript:;" class="webuploader-pick" title="图片空间">选择图片</a></div>
                            <div class="upload-box upload-img"></div>
                            <span class="Validform_checktip">*建议图片大小150*150 </span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">支付宝打赏</label>
                        <div class="layui-input-block">
                            @Html.TextBox("rewardalipay", Model.rewardalipay, new { @class = "input normal upload-path" })
                            <div class="upload-box choose-pick"><a href="javascript:;" class="webuploader-pick" title="图片空间">选择图片</a></div>
                            <div class="upload-box upload-img"></div>
                            <span class="Validform_checktip">*建议图片大小150*150 </span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">微信打赏</label>
                        <div class="layui-input-block">
                            @Html.TextBox("rewardwx", Model.rewardwx, new { @class = "input normal upload-path" })
                            <div class="upload-box choose-pick"><a href="javascript:;" class="webuploader-pick" title="图片空间">选择图片</a></div>
                            <div class="upload-box upload-img"></div>
                            <span class="Validform_checktip">*建议图片大小150*150 </span>
                        </div>
                    </div>
                </div>
                <!--/其它扩展设置-->
            </div>
        </div>
    </div>
    <!--/内容-->
    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-wrap">
            <button class="layui-btn icon-btn" id="btnSubmit"><i class="layui-icon layui-icon-ok"></i>提交保存</button>
        </div>
    </div>
    <!--/工具栏-->
</form>
@section Scripts{
    <script type="text/javascript" src="/scripts/libs/js/uploader.js"></script>
    <script type="text/javascript">
        layui.use(['jqueryform', 'element', 'validform', 'fileChoose'], function () {
            var fileChoose = layui.fileChoose;
            $('.choose-pick').click(function () {
                var obj = $(this);
                fileChoose.open({
                    fileUrl: '',
                    listUrl: '/admin_ajax/files',
                    num: 1,
                    dialog: {
                        offset: '60px'
                    },
                    onChoose: function (res) {
                        if (res[0].type != "file") {
                            layer.msg('我只让你选择图片格式的文件', { icon: 2, time: 2000 }, function () { });
                            return;
                        }
                        obj.siblings(".upload-path").val(res[0].url);
                        obj.siblings(".layer-photos").show().find("img").attr("src", res[0].url);
                    }
                });
            });
            //初始化表单验证
            $("#form1").initValidform('#btnSubmit', 1);
            
            //初始化上传控件
            $(".upload-img").InitUploader({ sendurl: "/upload_ajax/action", swf: "/scripts/libs/module/uploader/uploader.swf" });
            
            $("#divCache").autoCheckbox();
            $("#saveCtrol").autoSelect();
            $("#imgCtrol").autoSelect();
        });
    </script>
}